perm filename DATIME.POX[POX,WD] blob sn#397683 filedate 1978-11-18 generic text, type T, neo UTF8
\|\\;				Define Brick Character
\;
\M0FIX25;\;	fixed font

\⊂'000040;\;	VERREM - REM's syntax for defining macros with args 
\⊂'000400;\;	VERRHT - modified way to pass args with nest chars
\;
\@NUMER.POX[POX,WD];\;		read in numeric macros
\;    Macro to expand month number (decimal string) into month name
\;
\8MONTHNAME(NSTR)[\!MONTH⊗NSTR⊗;]\;
\	;\∞MONTH1[JANUARY]\∞MONTH2[FEBRUARY]\∞MONTH3[MARCH]\∞MONTH4[APRIL]\;
\	;\∞MONTH5[MAY]\∞MONTH6[JUNE]\∞MONTH7[JULY]\∞MONTH8[AUGUST]\;
\	;\∞MONTH9[SEPTEMBER]\∞MONTH10[OCTOBER]\∞MONTH11[NOVEMBER]\;
\	;\∞MONTH12[DECEMBER]\;
\;
\;
\∞DAY[\N		extract day from date and time in ac
\	;\P\N			save ac
\	;\L=-18;\N		peel off date with lsh
\	;\%=31;\N		get day of month
\	;\+=1;\N		add 1 to normalize
\	;\D∀\N			convert to string
\	;\p]\;			restore ac
\;
\∞MONTH[\N		extract month from date and time in ac
\	;\P\N			save ac
\	;\L=-18;\N		peel off date with lsh
\	;\/=31;\N		convert it to months
\	;\%=12;\N		get month of year
\	;\+=1;\N		add 1 to normalize
\	;\!MONTHNAME(\D∀);\N	convert to month name
\	;\p]\;			restore ac
\;
\∞YEAR[\N		extract year from date and time in ac
\	;\P\N			save ac
\	;\L=-18;\N		peel off date with lsh
\	;\/=372;\N		convert to years
\	;\+=1964;\N		in Gregorian cal
\	;\D∀\N			convert to string
\	;\p]\;			restore ac
\;
\∞SECOND[\N		extract second from date and time in ac
\	;\P\N			save ac
\	;\∧'777777;\N		pull out time in seconds
\	;\%=60;\N		find no of seconds after hour
\	;\D∀\N			convert to string
\	;\p]\;			restore ac
\;
\∞MINUTE[\N		extract minute from date and time in ac
\	;\P\Q0\N			save ac and reg 0
\	;\∧'777777;\N			pull out time in seconds
\	;\/=60;\N			convert to minutes
\	;\%=60;\N			find no of minutes after hour
\	;\→0\N				store in 0
\	;\←=9;\N			put 9 in ac
\	;\¬0\N				sub ac from 0
\	;\!COMPAC;\N			complement ac
\	;\?EVAL((0));\N 		print leading zero
\	;\←0\N				put mins in ac
\	;\D∀\N				convert to string
\	;\q0\p]\;			restore ac and reg 0
\;
\∞HOUR[\N		extract hour from date and time in ac
\	;\P\Q0\N			save ac
\	;\∧'777777;\N			pull out time in seconds
\	;\/=3600;\N			find the hour
\	;\→0\N				store in 0
\	;\←=9;\N			put 9 in ac
\	;\¬0\N				sub ac from 0
\	;\!COMPAC;\N			complement ac
\	;\?EVAL( );\N			print space
\	;\←0\N				put hours in ac
\	;\D∀\N				convert to string
\	;\q0\p]\;			restore ac
\;
\∞SYSEDAYTIMEFORM[\N	convert REM date and time to system form
\	;\Q0\N			save reg 0
\	;\P\N			push date and time
\	;\∧'777777000000;\N	extract date
\	;\→0\N			save in reg 0
\	;\p\N			restore date and time
\	;\∧'777777;\N		pull out time in minutes
\	;\*=60;\N		convert to seconds
\	;\∨0\N			or in contents of reg 0
\	;\q0]\;			restore reg 0
\;
\∞RESETDAYTIME[\N		reset date and time data
\	;\∂←FILDA;\N
\	;\∂←FILMO;\N
\	;\∂←FILYR;\N
\	;\∂←FILHR;\N
\	;\∂←FILMIN;\N
\	;\∂←FILDAYTIME;\N
\	;\∂←DATIM;\N				expunge date and time overlay
\	;\!SETUPDAYTIME;\N			and get new data
\	;]\;
\;
\∞SETUPDAYTIME[\N
\	;\∃∀\N				date and time to ac
\	;\!SYSEDAYTIMEFORM;\N
\	;\!EVAL((\∞)(FILDA[)\!DAY;(]));\N	day last edited
\	;\!EVAL((\∞)(FILMO[)\!MONTH;(]));\N	month last edited
\	;\!EVAL((\∞)(FILYR[)\!YEAR;(]));\N	year last edited
\	;\!EVAL((\∞)(FILMIN[)\!MINUTE;(]));\N	minute last edited
\	;\!EVAL((\∞)(FILHR[)\!HOUR;(]));\N	hour last edited
\	;\!EVAL((\∞)(FILDAYTIME[)\N
\			;\!FILDA;( )\!FILMO;( )\!FILYR;( )\N
\			;\!FILHR;:\!FILMIN;(]));\N
\	;\oDATIM{0\!FILDAYTIME;}\N
\	;\N					make day&time overlay
\	;]\;
\;
\;\u'400101;\;